package com.gthncz;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.gthncz.beans.TextEditor;
import com.gthncz.config.TextEditorConfig;

public class TextEditorConfigDemo {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		ApplicationContext context = new AnnotationConfigApplicationContext(TextEditorConfig.class);
		TextEditor textEditor = (TextEditor) context.getBean("textEditor");
		textEditor.spellCheck();
		textEditor.autoComplete();  // 需要设置 @Autowired 注解，否则没有将 AutoComplement 注入到 TextEditor 中，报 NullPointerException
	}

}
